//导入request.js请求工具
import request from '@/utils/request.js'

//寻找所有地区接口
export const FindAllNameService = () => {
    return request.get('/region/name')
}

//通过地区和日期找数据
export const SearchInfo = (regiondata) => {
    const params = new URLSearchParams()
    for (let key in regiondata) {
        params.append(key, regiondata[key]);
    }
    return request.post('/region/SearchInfo', params);
}

//查询所有城市数量
export const TotalRegion = () => {
    return request.get('/region/TotalRegion')
}

//查询总数电量
export const TotalElectric = (regiondata) => {
    const params = new URLSearchParams()
    for (let key in regiondata) {
        params.append(key, regiondata[key]);
    }
    return request.post('/region/TotalElectric', params);
}

//查询平均气温
export const AvgTemperature = (regiondata) => {
    const params = new URLSearchParams()
    for (let key in regiondata) {
        params.append(key, regiondata[key]);
    }
    return request.post('/region/AvgTemperature', params);
}

//
export const SearchInfo_no_load_name = (regiondata) => {
    const params = new URLSearchParams()
    for (let key in regiondata) {
        params.append(key, regiondata[key]);
    }
    return request.post('/region/SearchInfo_no_load_name', params);
}

export const monthly_power_2023 = () => {
    return request.get('/region/monthly_power_2023')
}

export const monthly_power_2024 = () => {
    return request.get('/region/monthly_power_2024')
}

export const Forecast = (regiondata) => {
    const params = new URLSearchParams()
    for (let key in regiondata) {
        params.append(key, regiondata[key]);
    }
    return request.post('/region/Forecast', params);
}